package com.yoyoyo666.report.service;

import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import com.alibaba.fastjson.JSON;
import com.yoyoyo666.report.model.ReportContent;

import java.io.File;
import java.util.List;

public class Test {

    public static void main(String[] args) {
        File file  = new File("/home/ljs/ljs.xls");

        ImportParams importParams = new ImportParams();
        importParams.setTitleRows(1);

        List<ReportContent> objects = ExcelImportUtil.importExcel(file, ReportContent.class, importParams);


        final String s = JSON.toJSONString(objects);
        System.out.println(s);
    }

}
